<template>
	<view class="paymentBox">
			<view class="bgWhite plr13 ptb10 mlr15 mt15 radius10 ">
					<view class="justify-between ptb10 ">
						<text class="label">问题</text> <input type="text" placeholder="请输入问题名称" text-align="right" v-model="title" />
					</view>
					<uv-line></uv-line>
					<view class=" ptb10 ">
						<view class="label">描述</view> <textarea type="text" placeholder="请输入问题描述" auto-height v-model="des" />
					</view>
			</view>
			<view class="bgWhite plr13 ptb10 mlr15 mt15 radius10 ">
					<view class=" ptb10 ">
						<text class="label">联系方式</text> <input type="number" placeholder="请填写您的联系方式，尽快帮您解决问题-" text-align="right" v-model="phone" />
					</view>
				
			</view>
			<view class="save_btn" @click="save">
				提交
			</view>
		
	</view>
</template>

<script>
	import operate from '@/common/operate.js'
	export default {
		data() {
			return {
				title:"",
				des:"",
				phone:""
			};
		},
        onLoad(opt) {
            // this.getPayMode()
         
        },
		methods: {
			
            save(){
                    
                    if(!this.title) return this.$utils.msg('请输入问题名称')
					if(!this.des) return this.$utils.msg('请输入问题描述')
					if(!this.phone) return this.$utils.msg('请输入手机号')
                    uni.showLoading({
                        title:'加载中'
                    })
                    this.$api.addSuggest({
						title:this.title,
						des:this.des,
						phone:this.phone
					}).then(res=>{
                        uni.hideLoading()
                        
                        if(res.code==1){
                            this.$utils.msg('提交成功')
                            setTimeout(()=>{
                              uni.navigateBack()
                            },800)
                        }else{
                            this.$utils.msg(res.msg)
                        }
                    })
                    
            }
		}
	}
</script>

<style lang="scss" scoped>
	textarea{
		min-height: 100rpx;
	}
	.label{
		
	}
	.save_btn {
		
		height: 90rpx;
		margin-top: 52rpx;
		margin:  30rpx;
		margin-bottom: 40rpx;
		background: #2CC6A1;
		border-radius: 8rpx;
		font-size: 32rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 90rpx;
	}
</style>